﻿DataNavigateUrlFields<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Display.aspx.cs" Inherits="WebApplicationRating.Display" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    </div>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource1">
        <Columns>
       <asp:BoundField DataField="imageid" HeaderText="ID" InsertVisible="False" 
                ReadOnly="True" SortExpression="imageid" />
            <asp:BoundField DataField="name" HeaderText="ImageName" 
                SortExpression="name" />
       <asp:TemplateField HeaderText="Image">
<ItemTemplate>
<asp:Image ID="Image1" runat="server" Width='200'
           ImageUrl='<%# "Handler.ashx?imageid=" + Eval("imageid")%>'/>
</ItemTemplate>
</asp:TemplateField>
   <asp:HyperLinkField DataNavigateUrlFields="imageid" DataNavigateUrlFormatString="./Views/UserImageRatings.aspx?MGID={0}" HeaderText="Rating" Text="Add++ My Rating"/>
        </Columns>
    </asp:GridView>
&nbsp;<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:imageConnectionString %>" 
        SelectCommand="SELECT [imageid], [name], [image_file] FROM [Image]">
    </asp:SqlDataSource>
    </form>
</body>
</html>
